package com.opennews.openplatform.familyexpenseapi.config

import com.opennews.openplatform.familyexpenseapi.security.SecurityActiveTokenManager
import com.opennews.openplatform.myspringbootcore.security.AuthRequestValidator
import com.opennews.openplatform.myspringbootcore.security.RequestMapManager
import com.opennews.openplatform.myspringbootcore.security.TokenManager
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.env.Environment

@Configuration
class AuthRequestValidatorConfig {
    @Bean
    fun authRequestValidator(
        env: Environment,
        requestMapManager: RequestMapManager,
        securityActiveTokenManager: SecurityActiveTokenManager,
        tokenManager: TokenManager,
    ): AuthRequestValidator {
        return AuthRequestValidator(
            env,
            requestMapManager,
            securityActiveTokenManager,
            tokenManager,
            WebConfig.API_PATH_PREFIX,
        )
    }
}
